<?php header('Content-type: text/html; charset=UTF-8'); ?>
<!DOCTYPE html>

<html>

<head>
    <?php $this->Html->charset('utf-8'); ?>
    <?php echo $this->Html->script('jquery-1.9.1.js'); ?>
    <?php echo $this->Html->script('jquery.galleriffic.js'); ?>
    <?php echo $this->Html->script('jquery.opacityrollover.js'); ?>
    <?php echo $this->Html->script('jquery-ui-1.10.2.custom.min.js'); ?>


    <?php echo $this->Html->css('redmond/jquery-ui-1.10.2.custom.min.css'); ?>
    <?php echo $this->Html->css('galeria/basic.css'); ?>
    <?php echo $this->Html->css('galeria/galleriffic-4.css'); ?>
    <?php echo $this->Html->script('jquery.dataTables.min.js'); ?>
    <?php echo $this->Html->css('demo_table.css'); ?>
    <?php echo $this->Html->css('modern.css'); ?>
    <?php echo $this->Html->css('custom.css'); ?>
    <?php echo $this->Html->css('modern-responsive.css'); ?>
    <?php echo $this->Html->script('/javascript/dropdown.js'); ?>
    <?php echo $this->Html->script('/javascript/dialog.js'); ?>
    <?php echo $this->Html->script('/javascript/pagecontrol.js'); ?>


    <script type="text/javascript">
        document.write('<style>.noscript { display: none; }</style>');
    </script>

    <title>
        <?php echo $title_for_layout; ?>
    </title>
    <?php
    echo $this->Html->meta('icon');

    //echo $this->Html->css('cake.generic');

    echo $this->fetch('meta');
    echo $this->fetch('css');
    echo $this->fetch('script');
    ?>
</head>
<body class="metrouicss">
<div class="page">
    <div class="nav-bar">
        <nav class="nav-bar-inner padding10">
            <span class="pull-menu"></span>
            <a href="/cafete">
                <span class="element brand">
                <span class="icon-home"></span>
                Panel de Control Café & Té
                </span>
            </a>

            <div class="divider"></div>
            <ul class="menu">
                <?php
                $user = $this->Session->read('Auth.User');
                if ($user['role'] === 'admin') {
                    ?>

                    <li data-role="dropdown"><a href="#">Gestión de Usuarios</a>
                        <ul class="dropdown-menu">
                            <li><?php echo $this->Form->postLink('Añadir Usuario', array('controller' => 'users', 'action' => 'add')); ?></li>
                            <li><?php echo $this->Form->postLink('Ver Usuarios', array('controller' => 'users', 'action' => 'index')); ?></li>
                        </ul>
                    </li>
                    <li><?php echo $this->Html->link("Cerrar sesión", array('controller' => 'users', 'action' => 'logout')); ?></li>
                    <?php } else if ($user['role'] === 'cafeytelasrozas') { ?>
                    <li data-role="dropdown"><a href="#">Cartas</a>
                        <ul class="dropdown-menu">
                            <li><?php echo $this->Form->postLink('Gestionar cartas', array('controller' => 'cartas', 'action' => 'index'));?></li>
                        </ul>
                    </li>
                    <li data-role="dropdown"><a href="#">Secciones de cartas</a>
                        <ul class="dropdown-menu">
                            <li><?php echo $this->Form->postLink('Asignar platos a cartas', array('controller' => 'cartaCategorias', 'action' => 'index'));?></li>

                            <!--                            <li>--><?php //echo $this->Form->postLink('Gestionar secciones', array('controller' => 'categorias', 'action' => 'index'));?><!--</li>-->
<!--                            <li>--><?php //echo $this->Form->postLink('Añadir categorías a cartas', array('controller' => 'cartasections', 'action' => 'index'));?><!--</li>-->
                        </ul>
                    </li>
                    <li data-role="dropdown"><a href="#">Platos</a>
                        <ul class="dropdown-menu">
                         <li><?php echo $this->Form->postLink('Gestionar platos', array('controller' => 'productos', 'action' => 'index')); ?></li>
                        </ul>
                    </li>
                    <li data-role="dropdown"><a href="#">Secciones del día</a>
                        <ul class="dropdown-menu">
                            <li><?php echo $this->Form->postLink('Gestionar las secciones del día', array('controller' => 'sections', 'action' => 'index'));?></li>
                        </ul>
                    </li>
                    <li><?php echo $this->Form->postLink("Cerrar sesión", array('controller' => 'users', 'action' => 'logout')); ?></li>
                    <?php } ?>
            </ul>
        </nav>
    </div>
</div>

<!--nocache-->
<?php echo $this->fetch('content'); ?>
<!--/nocache-->
</body>
<!--div class="app-bar">
    <?php /*echo $this->Html->link(
    $this->Html->image('cake.power.gif', array('alt' => 'Desarrollado por Developando', 'border' => '0')),
    'http://www.developando.com/',
    array('target' => '_blank', 'escape' => false)
);*/
    ?>
</div-->
<?php //echo $this->element('sql_dump'); ?>
</html>
